<template>
  <div class="demo-container">
    <div class="demo-header">
      <h1>安全文化页面演示</h1>
      <p>这是一个基于您提供的UI设计图创建的安全文化展示页面</p>
    </div>

    <div class="demo-content">
      <div class="demo-section">
        <h2>页面功能</h2>
        <ul>
          <li>✅ 顶部安全文化标题栏</li>
          <li>✅ 10个功能模块的导航栏</li>
          <li>✅ 左右两列内容展示区域</li>
          <li>✅ 视频播放器界面</li>
          <li>✅ 安全文化星级建设图表</li>
          <li>✅ 安全价值链文件下载</li>
          <li>✅ 完全响应式设计</li>
        </ul>
      </div>

      <div class="demo-section">
        <h2>快速访问</h2>
        <div class="demo-buttons">
          <el-button
            type="primary"
            size="large"
            @click="goToSafetyCulture"
            icon="el-icon-view"
          >
            查看安全文化页面
          </el-button>
          <el-button
            type="success"
            size="large"
            @click="openInNewTab"
            icon="el-icon-link"
          >
            新窗口打开
          </el-button>
        </div>
      </div>

      <div class="demo-section">
        <h2>技术特点</h2>
        <div class="tech-grid">
          <div class="tech-item">
            <i class="el-icon-monitor"></i>
            <h3>响应式设计</h3>
            <p>支持各种屏幕尺寸，移动端友好</p>
          </div>
          <div class="tech-item">
            <i class="el-icon-picture"></i>
            <h3>现代化UI</h3>
            <p>使用Element UI组件，界面美观</p>
          </div>
          <div class="tech-item">
            <i class="el-icon-cpu"></i>
            <h3>Vue.js框架</h3>
            <p>组件化开发，易于维护和扩展</p>
          </div>
          <div class="tech-item">
            <i class="el-icon-magic-stick"></i>
            <h3>自定义样式</h3>
            <p>完全按照设计图定制，色彩搭配协调</p>
          </div>
        </div>
      </div>

      <div class="demo-section">
        <h2>页面预览</h2>
        <div class="preview-container">
          <div class="preview-item">
            <h4>顶部导航</h4>
            <div class="preview-mock">
              <div class="mock-top-bar">安全文化</div>
              <div class="mock-nav">
                <span class="mock-nav-item active">企业安全文化理念体系</span>
                <span class="mock-nav-item">安全动态</span>
                <span class="mock-nav-item">安全法律法规</span>
              </div>
            </div>
          </div>
          <div class="preview-item">
            <h4>内容区域</h4>
            <div class="preview-mock">
              <div class="mock-content">
                <div class="mock-section">
                  <h5>企业安全文化理念体系</h5>
                  <ul>
                    <li>安全文化手册</li>
                    <li>安全十条</li>
                    <li>安全方针</li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
          <div class="preview-item">
            <h4>视频播放器</h4>
            <div class="preview-mock">
              <div class="mock-video">
                <div class="mock-play-btn">▶</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="demo-footer">
      <p>如需进一步定制或有任何问题，请联系开发团队</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SafetyCultureDemo',
  methods: {
    goToSafetyCulture() {
      // 在当前窗口打开安全文化页面
      this.$router.push('/animalManagement/safety/safety-culture');
    },
    openInNewTab() {
      // 在新窗口打开安全文化页面
      const url = `${window.location.origin}${window.location.pathname}#/animalManagement/safety/safety-culture`;
      window.open(url, '_blank');
    }
  }
}
</script>

<style scoped>
.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Microsoft YaHei', sans-serif;
}

.demo-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border-radius: 12px;
}

.demo-header h1 {
  color: #2e7d32;
  margin-bottom: 15px;
  font-size: 2.5em;
}

.demo-header p {
  color: #666;
  font-size: 1.2em;
  margin: 0;
}

.demo-section {
  margin-bottom: 40px;
  padding: 30px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.demo-section h2 {
  color: #2e7d32;
  margin-bottom: 20px;
  font-size: 1.8em;
  border-bottom: 2px solid #e8f5e8;
  padding-bottom: 10px;
}

.demo-section ul {
  list-style: none;
  padding: 0;
}

.demo-section li {
  padding: 8px 0;
  color: #333;
  font-size: 1.1em;
}

.demo-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.tech-item {
  text-align: center;
  padding: 20px;
  border: 1px solid #e8f5e8;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tech-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tech-item i {
  font-size: 3em;
  color: #4caf50;
  margin-bottom: 15px;
}

.tech-item h3 {
  color: #2e7d32;
  margin-bottom: 10px;
}

.tech-item p {
  color: #666;
  line-height: 1.5;
}

.preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.preview-item h4 {
  color: #2e7d32;
  margin-bottom: 15px;
  text-align: center;
}

.preview-mock {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.mock-top-bar {
  background: #2e7d32;
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: bold;
}

.mock-nav {
  background: #81c784;
  padding: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mock-nav-item {
  background: #4caf50;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.mock-nav-item.active {
  background: #2e7d32;
}

.mock-content {
  padding: 15px;
}

.mock-section h5 {
  color: #2e7d32;
  margin-bottom: 10px;
  font-size: 14px;
}

.mock-section ul {
  list-style: none;
  padding: 0;
}

.mock-section li {
  padding: 3px 0;
  font-size: 12px;
  color: #666;
}

.mock-video {
  background: #e8f5e8;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-play-btn {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4caf50;
  font-size: 18px;
  cursor: pointer;
}

.demo-footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
  .demo-container {
    padding: 10px;
  }

  .demo-header h1 {
    font-size: 2em;
  }

  .demo-buttons {
    flex-direction: column;
    align-items: center;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .preview-container {
    grid-template-columns: 1fr;
  }
}
</style>
